package com.platform.study.thread;

/**
 * 用实现Runnable接口方式实现线程:线程优先级
 * User: wangyanginfo
 * Date: 12-11-26
 * Time: 下午2:44
 */
public class RunnableSimple_6 implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 500; ++i) {
            System.out.println(Thread.currentThread().getName() + " 正在运行 " + i);
        }
    }

    public static void main(String[] args) {
        Thread threadA = new Thread(new RunnableSimple_6(), "线程1");
        Thread threadB = new Thread(new RunnableSimple_6(), "线程2");
        Thread threadC = new Thread(new RunnableSimple_6(), "线程3");
        threadA.setPriority(8);
        threadB.setPriority(2);
        threadC.setPriority(6);
        threadA.start();
        threadB.start();
        threadC.start();
    }
}
